package com.supermarket.api.common.exception;

import com.supermarket.api.common.ErrorMessage;

/**
 * 异常基础类
 * @author li
 */
public class BaseException extends RuntimeException{

	private int code = 1;


	private static final long serialVersionUID = 1L;

	public BaseException() {
		super();
	}
	
	public BaseException(String message) {
		 super(message);
	}


	public BaseException(String message,int code) {
		super(message);
		this.code = code;
	}

	public BaseException(ErrorMessage err) {
		super(err.getMessage());
		this.code = err.getCode();
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
}